<template>
	<view class="myOrderBox">

		<uv-tabs :list="list" lineWidth="69" lineHeight="2" :scrollable="false" lineColor="#3662EC" :activeStyle="{
			color: '#3662EC',
			fontSize: '36rpx',
			fontWeight: '500',
			transform: 'scale(1.05)'
    	}" :inactiveStyle="{
			color: '#3D3D3D',
			fontSize: '36rpx',
			transform: 'scale(1)'
		}" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;" @change="click"></uv-tabs>
		<view class="" style="height: 40rpx;">

		</view>
		<block v-if="cateId==1">
			<view class="artItem bgWhite  pb15 mlr15 mb15 " v-for="(i,n) in orderList" :key="n" style="border-bottom: 1px solid #e2e2e2;"  >
				<view class="justify-between align-center">
					<image src="../../static/images/f.png" style="width: 100rpx;height: 100rpx;border-radius: 50%;" mode=""></image>
					<view class="flex-col ml10 flex1  left  justify-center mr20 " @click="toMain(i)">
						<view class="name clamp2">{{i.company}}</view>
						<view class="name">
							{{i.realname}}  
						</view>
						
						
					</view>
				</view>
				
				<view v-if="i.business_type" class="mt10 plr10 ptb3" style="color: #fff; background-color: #FFBC47;border-radius: 60rpx; display: inline-block;">
					{{i.business_type||''}}
				</view>
				
				
			</view>
		</block>
		<actItem v-if="cateId==2" :datas="orderList"></actItem>
		<block v-if="cateId==3">
		<view class="artItem bgWhite   mlr15 mb15 justify-between align-center"  v-for="(i,n) in orderList" :key="n" @click="toMains(i)">
			<view class="flex-col  flex1 left  justify-center mr20 ">
				<view class="name clamp2">{{i.title}}</view>
				<text class="time">{{i.create_time}}</text>
				<!-- <view class="collect align-center justify-center">
					<uv-icon name="star" color="#000"></uv-icon>
					收藏
				</view> -->
			</view>
			<image :src="$domain.api+i.img_url" mode=""></image>
		</view>
		</block>
		<view class="" v-if="orderList.length==0">
			<uv-empty mode="data" icon="https://cdn.uviewui.com/uview/empty/data.png"></uv-empty>
		</view>

	</view>
</template>

<script>
	import actItem from '../../components/actItem.vue';
	export default {
		components: {
			actItem
		},
		data() {
			return {
				list: [{
						name: "合作对接",
					},
					{
						name: "活动论坛",
					},
					{
						name: "研究报告",
					}
				],
				cateId: 1,
				orderList: [],
				user_id: uni.getStorageSync('userId')

			};
		},
		onLoad() {
			this.getData()
		},
		onShow() {
			// if (!uni.getStorageSync('logintoken')) {
			// 	uni.reLaunch({
			// 		url: '/pages/login/login'
			// 	})
			// 	return
			// }
			// this.getOrder()
		},
		methods: {
			getData() {
				this.$api.mycollect({
					userId: this.user_id,
					categoryId: this.cateId
				}).then(res => {
					console.log(res)
					this.orderList = res.data
				})
			},
			click(e) {
				this.cateId = e.index + 1
				this.getData()
			},
			toMain(i){
					uni.navigateTo({
						url:'/pages/company/index?id='+i.id
					})
			},
				
			toMains(i){
				uni.navigateTo({
					url:'/pages/reportMain/index?id='+i.id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.myOrderBox {
		min-height: 100vh;
		position: relative;

		padding: 20rpx 30rpx;


	}

	.submitPz {
		width: 165rpx;
		height: 54rpx;
		background: #434343;
		border-radius: 6rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 54rpx;
	}

	.artItem {



		margin-bottom: 36rpx;
		font-size: 24rpx;
		color: #666666;

		.left {}

		.time {
			font-weight: 400;
			font-size: 20rpx;
			color: #666666;
			margin: 12rpx 0 16rpx;

		}

		.name {
			
			font-size: 30rpx;
			color: #3D3D3D;
		}

		image {
			width: 232rpx;
			height: 162rpx;
		}
	}

	.collect {
		border-radius: 60rpx;
		border: 2rpx solid rgba(0, 0, 0, 0.1);
		width: 122rpx;
		height: 52rpx;

		box-sizing: content-box;
	}

	.service {
		width: 140rpx;
		height: 66rpx;
		background: #E6220A;
		color: #fff;
		text-align: center;
		font-size: 32rpx;
		line-height: 66rpx;
		border-radius: 60rpx 60rpx 60rpx 60rpx;
		margin-right: 20rpx;
	}
	
</style>